home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / lang / perl_src.lha / fsf / perl / os2 / perl2cmd.pl < prev    next >
Encoding:
Text File  |  1996-03-25  |  758 b   |  29 lines

  1. # This will put installed perl files into some other location
  2. # Note that we cannot put hashbang to be extproc to make Configure work.
  3.  
  4. use Config;
  5.  
  6. $dir = shift;
  7. $dir =~ s|/|\\|g ;
  8. $nowarn = 1, $dir = shift if $dir eq '-n';
  9.  
  10. die <<EOU unless defined $dir and -d $dir;
  11. usage:    $^X $0 [-n] directory-to-install
  12.   -n    do not check whether the directory is not on path
  13. EOU
  14.  
  15. @path = split /;/, $ENV{PATH};
  16. $idir = $Config{installbin};
  17. $indir =~ s|\\|/|g ;
  18.  
  19. foreach $file (<$idir/*.>) {
  20.   $base = $file;
  21.   $base =~ s/\.$//;        # just in case...
  22.   $base =~ s|.*/||;
  23.   $file =~ s|/|\\|g ;
  24.   print "Processing $file => $dir\\$base.cmd\n";
  25.   system 'cmd.exe', '/c', "echo extproc perl -Sx > $dir\\$base.cmd";
  26.   system 'cmd.exe', '/c', "type $file >> $dir\\$base.cmd";
  27. }
  28.  
  29.